﻿using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace BF3StatsNetApi.BLL
{
    public class Vehcat
    {
        public string name { get; set; }
        public double time { get; set; }
        public long kills { get; set; }
        public long score { get; set; }
        public string img { get; set; }
        public string img_bk { get; set; }
        private List<Unlock> _unlocks;
        public object unlocks { 
            get { return _unlocks; } 
            set {
                _unlocks = new List<Unlock>();
                foreach (JToken u in (JArray)value)
                {
                    Unlock _unlock = JsonConvert.DeserializeObject<Unlock>(u.ToString());
                    _unlocks.Add(_unlock);
                }
            } 
        }
        public Star star { get; set; }
    }
}
